package com.basin.feign.config;

import com.basin.common.core.exception.BasinException;
import com.basin.feign.config.vo.FeignReqSettingsVO;
import com.basin.feign.util.SignUtil;

import java.util.Map;

/**
 * @author: Sam ZHONG | sammy1997@aliyun.com
 */
public interface Init4FeignLogic {
    default Map<String, FeignReqSettingsVO> collectFeignReqSettings() {
        throw new BasinException("【basin-feign】请主动实现接口-Init4FeignLogic");
    }

    default boolean validAuthorization(FeignReqSettingsVO vo, String token) {
        String signature = SignUtil.createSignature(vo);
        return signature.equals(token);
    }
}
